using System.Collections.Generic;
using UnityEngine;

namespace Yoozoo.Gameplay.Liberty.AI
{
    public class PhysicsCasterCollection : PhysicsCaster
    {
        public List<PhysicsCaster> casters;

        public override void Cast()
        {
            if (casters != null)
            {
                foreach (var caster in casters)
                {
                    if (caster != null)
                    {
                        caster.Cast();
                    }
                }
            }
        }

        public override void SetCastDistance(float d)
        {
            foreach (var caster in casters)
            {
                if (caster != null)
                {
                    caster.SetCastDistance(d);
                }
            }
        }

        public override void GetHitInfo(ref List<RaycastHit> hitInfos)
        {
            if (casters!=null)
            {
                foreach (var caster in casters)
                {
                    if (caster!=null)
                    {
                        caster.GetHitInfo(ref hitInfos);
                    }
                }
            }
        }
        
        
    }
}